#pragma once

#include "Thread.h"
#include "Connection.h"
#include <concurrent_vector.h>
#include <vector>

struct Client
{
	int id;
	
	bool connected;
};

class Game;

class Server : public Thread
{
	public:
		Server()	{}
		~Server()	{}

		int		run();
		int		init();

		void	setSendBuffer(void* buff) { m_sendBuffer = buff; }
		void*	m_sendBuffer;
		int		m_bufferSize;

		void	connectionError(int id);
		Game*	m_game;

	private:
		SOCKET	m_listeningSocket;

		Concurrency::concurrent_vector<Connection> connections;
		
		

};